package com.swy.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

@Controller
@RequestMapping("/detector")
public class AuthController {
    
    @GetMapping("/login")
    public String loginPage() {
        return "login";
    }
    
    @PostMapping("/login")
    @ResponseBody
    public String login(@RequestParam String username, @RequestParam String password) {
        // 模拟登录验证
        if ("admin".equals(username) && "123456".equals(password)) {
            return "success";
        }
        return "用户名或密码错误";
    }
} 